# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: scrapy爬虫单机发送通知邮件.py
@time: 2021/9/10 21:36
'''
#  安装可以发送邮件的包 pip install yagmail

import yagmail

def send_mail_to_myself():
    main_host = 'smtp.qq.com'
    main_user = '2863535704@qq.com'
    mail_pass = 'kpuhlplsrgkfdgcb'
    sender = yagmail.SMTP(user=main_user,password = mail_pass,host = main_host,smtp_ssl = False,port = 25)
    text = ['hello word']
    sender.send(to = 'operationers@163.com',subject = 'scrapy爬虫挂了',contents = text)
    print('发送成功')







